//河流概化河段
Ext.define("Admin.view.sys.DdsMRiver", {
	extend: "Admin.common.container.BaseContainer",
	xtype: "ddsMRiver",
	alias: "ddsMRiver",
	requires: [
		"Ext.panel.Panel",
		"Ext.grid.Panel",
		"Ext.button.Button",
		"Admin.common.form.SearchFormPanel",
		"Admin.store.sys.DdsMRiver",
	],
	controller: "ddsMRiverController",
	layout: 'fit',
	width: '100%',
	height: 200,

	items: [{
		title: "河流概化河段",
		xtype: "baseGridPanel",
		reference: "riverGrid",
		border: true,
		columns: [
			// {
			// 	header: "河流", dataIndex: "river", align: "center", flex: 1, renderer: function (value, record) {
			// 		if (value == '02') {
			// 			return '抚河';
			// 		} else {
			// 			return '袁河';
			// 		}
			// 	}
			// },
			{
				header: "污染发生河段代码",
				dataIndex: "rcd",
				align: "center",
				flex: 1,
			},
			{
				header: "污染位置河段",
				dataIndex: "rnm",
				align: "center",
				flex: 1
			},
			{
				header: "模拟计算河段",
				dataIndex: "calriver",
				align: "center",
				flex: 1
			},
			{
				xtype: "actioncolumn",
				text: "操作",
				align: "center",
				width: 100,
				sortable: false,
				menuDisabled: true,
				items: [{
					iconCls: "x-fa fa-edit",
					tooltip: "编辑",
					handler: "riverUpdate"
				},
				{
					iconCls: "x-fa fa-times-circle",
					tooltip: "删除",
					handler: "riverDelete"
				}
				]
			}
		],
		store: {
			type: "ddsMRiver"
		},
		tbar: [{
			xtype: "searchFormPanel",
			columns: 2,
			items: [
				// {
				// 	xtype: "dicComboBox",
				// 	dicType: 'rivername',
				// 	maxWidth: 300,
				// 	fieldLabel: "河流名称",
				// 	labelWidth: 100,
				// 	reference: 'serchName',
				// },
				{
					xtype: "dicComboBox",
					dicType: 'riverRcd',
					maxWidth: 300,
					fieldLabel: "污染发生河段",
					labelWidth: 100,
					reference: 'serchRcd',
					listeners: {
						added: function () {
							var store = this.getStore();
							store.clearFilter();
							store.filter({
								property: 'river',
								value: config.RIVER
							});
						}
					}
				},
			]
		},
			"->",
		{
			xtype: "button",
			iconCls: "x-fa fa-search",
			text: "查询",
			handler: "riverSearch"
		},
		{
			xtype: "button",
			iconCls: "x-fa fa-save",
			text: "新增",
			handler: "riverAdd"
		}
		],
		bbar: {
			xtype: "pagingtoolbar",
			autoLoad: true,
			displayInfo: true,
			displayMsg: "显示从第{0}条数据到第{1}条数据，共{2}条数据",
			emptyMsg: "没有记录"
		}
	},

	]
});


Ext.define("Admin.view.sys.RiverForm", {
	// extend: 'Ext.form.Panel',
	extend: "Admin.common.form.BaseFormPanel",
	xtype: "riverForm",
	alias: "riverForm",
	bodyPadding: 10,
	layout: "anchor",
	defaults: {
		anchor: "100%",
		labelWidth: 120,
		labelAlign: "right"
	},
	margin: "0 0 10 0",
	items: [{
		xtype: "textfield",
		fieldLabel: "污染发生河段代码",
		name: "rcd",
		allowBlank: false,
		emptyText: "请输入污染发生河段代码",
		reference: "riverRcd",
	},
	{
		xtype: "textfield",
		fieldLabel: "污染发生河段",
		name: 'rnm',
		allowBlank: false,
		emptyText: "请输入污染发生河段",
		allowBlank: false,
	},
	{
		xtype: "textfield",
		fieldLabel: "模拟计算河段",
		emptyText: "请输入模拟计算河段",
		allowBlank: false,
		name: "calriver",
	}
	]
});
